<?php

/**
 * index
 *
 * @category   View
 * @package    index
 * @subpackage AppView
 * @copyright  ${copyright}
 * @license    ${licenseTucho235}
 * @version    ${versionDevelopment}
 * @link       ${link}
 * @since      ${date}
 * @author     ${user}
 * @php        ${php}
 * 
 */
 
?>
<h1><?php echo __('Usuarios')?></h1>

<table class="table table-striped">
    <thead> 
        <tr>
            <th><?php echo __('Id'); ?></th>
            <th><?php echo __('Usuario');?></th>
            <th><?php echo __('Creado');?></th>
            <th><?php echo __('Acciones');?></th>
        </tr>
    </thead> 
    <tbody>
        <?php foreach ($users as $user): ?>
        <tr>
            <td><?php echo $user['User']['id']; ?></td>
            <td>
                <?php echo $this->Html->link($user['User']['username'],
                                            array('controller' => 'users', 'action' => 'view', $user['User']['id']),
                                            array('rel'=>'tooltip', 'title'=>$user['User']['username'])); ?>
            </td>
            <td><i class="icon-time "></i>&nbsp;<?php echo $user['User']['created']; ?></td>
            <td>
                <?php 
                        echo $this->Html->link( '', 
                             array('controller' => 'users', 
                                   'action'     => 'edit',
                                   $user['User']['id']),
                             array('class' => 'icon-edit',
                                   'title' => 'Editar',
                                   'rel'   =>'tooltip')
                        ); 
                ?>
                &nbsp;
                <?php
                        echo $this->Form->postLink('',
                                                   array('action' => 'delete', $user['User']['id']),
                                                   array('class'   => 'icon-trash',
                                                         'title'   => __('Eliminar'),
                                                         'confirm' => __('Esta seguro de que quiere eliminar el Usuario?')));
                ?>
                
            </td>
        </tr>
        <?php endforeach; ?>
        <?php unset($user); ?>
    </tbody>
</table>

<?php echo $this->Html->link(__('Nuevo Usuario'), 
                             array('controller' => 'users', 
                                   'action'     => 'add'), 
                             array('class' => 'btn',
                                   'rel'   => 'tooltip',
                                   'title' => 'Nuevo')); ?>